package com.ruoyi.system.service.impl;

import java.util.Arrays;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysGenTestMapper;
import com.ruoyi.system.domain.SysGenTest;
import com.ruoyi.system.service.ISysGenTestService;
import com.ruoyi.common.core.text.Convert;

/**
 * testService业务层处理
 * 
 * @author liupan
 * @date 2021-05-21
 */
@Service
public class SysGenTestServiceImpl extends ServiceImpl<SysGenTestMapper, SysGenTest> implements ISysGenTestService
{
    @Autowired
    private SysGenTestMapper sysGenTestMapper;

    /**
     * 查询test
     * 
     * @param id testID
     * @return test
     */
    @Override
    public SysGenTest selectSysGenTestById(Long id)
    {
        return sysGenTestMapper.selectSysGenTestById(id);
    }

    /**
     * 查询test列表
     * 
     * @param sysGenTest test
     * @return test
     */
    @Override
    public List<SysGenTest> selectSysGenTestList(SysGenTest sysGenTest)
    {
        return sysGenTestMapper.selectSysGenTestList(sysGenTest);
    }

    /**
     * 新增test
     * 
     * @param sysGenTest test
     * @return 结果
     */
    @Override
    public int insertSysGenTest(SysGenTest sysGenTest)
    {
        sysGenTest.setCreateTime(DateUtils.getNowDate());
        return sysGenTestMapper.insertSysGenTest(sysGenTest);
    }

    /**
     * 修改test
     * 
     * @param sysGenTest test
     * @return 结果
     */
    @Override
    public boolean updateSysGenTest(SysGenTest sysGenTest)
    {
        //sysGenTest.setUpdateTime(DateUtils.getNowDate());
        //return sysGenTestMapper.updateSysGenTest(sysGenTest);
        return this.saveOrUpdate(sysGenTest);
    }

    /**
     * 删除test对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public boolean deleteSysGenTestByIds(String ids)
    {
        //return sysGenTestMapper.deleteSysGenTestByIds(Convert.toStrArray(ids));
        return this.removeByIds(Arrays.asList(Convert.toStrArray(ids)));
    }

    /**
     * 删除test信息
     * 
     * @param id testID
     * @return 结果
     */
    @Override
    public boolean deleteSysGenTestById(Long id)
    {
        //return sysGenTestMapper.deleteSysGenTestById(id);
        return this.removeById(id);
    }
}
